#ifndef _ROS_robot_msgs_DriveError_h
#define _ROS_robot_msgs_DriveError_h

#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "ros/msg.h"

namespace robot_msgs
{

  class DriveError : public ros::Msg
  {
    public:
      typedef uint32_t _left_error_type;
      _left_error_type left_error;
      typedef uint32_t _right_error_type;
      _right_error_type right_error;

    DriveError():
      left_error(0),
      right_error(0)
    {
    }

    virtual int serialize(unsigned char *outbuffer) const
    {
      int offset = 0;
      *(outbuffer + offset + 0) = (this->left_error >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (this->left_error >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (this->left_error >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (this->left_error >> (8 * 3)) & 0xFF;
      offset += sizeof(this->left_error);
      *(outbuffer + offset + 0) = (this->right_error >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (this->right_error >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (this->right_error >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (this->right_error >> (8 * 3)) & 0xFF;
      offset += sizeof(this->right_error);
      return offset;
    }

    virtual int deserialize(unsigned char *inbuffer)
    {
      int offset = 0;
      this->left_error =  ((uint32_t) (*(inbuffer + offset)));
      this->left_error |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      this->left_error |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      this->left_error |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      offset += sizeof(this->left_error);
      this->right_error =  ((uint32_t) (*(inbuffer + offset)));
      this->right_error |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      this->right_error |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      this->right_error |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      offset += sizeof(this->right_error);
     return offset;
    }

    const char * getType(){ return "robot_msgs/DriveError"; };
    const char * getMD5(){ return "dd7a72f3719170a3c7819cdfbadb8242"; };

  };

}
#endif